<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>7-严格模式</title>
</head>
<body>
    <script type="text/javascript">
        //普通模式
        amount = 20;
        console.log(amount);
        (function(){
            //在立即函数里面就是严格模式
            /**
             * 之前是 
             * num = 10;
             * console.log(num); 不会报错的
             */
            "use strict";
            var num = 10;
            console.log(num);
        }());
    </script>
</body>
</html>